# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models

# Create your models here.


class ProjectInfo(models.Model):
    id = models.AutoField(blank=False,primary_key=True)
    IpAddress = models.CharField(blank=False,max_length=320)
    ProJectName = models.CharField(blank=False, max_length=48)
    ProPath = models.CharField(blank=False, max_length=128)
    GitAddress = models.CharField(blank=False, max_length=256)
    GitRepo = models.CharField(blank=False,max_length=32)
    UserName = models.CharField(blank=False, max_length=48)
    PassWord = models.CharField(blank=False, max_length=64)
    ConTent = models.TextField(blank=True, max_length=256)
    UpdateTime = models.CharField(blank=False, max_length=32)

    def __unicode__(self):
        return self.ProJectName


class ServerInfo(models.Model):
    id = models.AutoField(blank=False,primary_key=True)
    ServerIp = models.CharField(blank=False, max_length=24)

    def __unicode__(self):
        return self.ServerIp


class HostInfo(models.Model):
    id = models.AutoField(blank=False, primary_key=True)
    ServerIp = models.CharField(blank=False,max_length=24)
    HostName = models.CharField(blank=False,max_length=36)
    Note = models.CharField(blank=False, max_length=256)


    def __unicode__(self):
        return self.HostName

class Logs(models.Model):
    id = models.AutoField(blank=False, primary_key=True)
    OptUser = models.CharField(blank=False, max_length=32)
    Content = models.CharField(blank=False, max_length=1024)
    UpdateTime = models.CharField(blank=False, max_length=32)


    def __unicode__(self):
        return self.OptUser
